-
Notifications
You must be signed in to change notification settings - Fork 87
docs: translate composition api #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✔️ Deploy Preview for vuejs-v3-ja-doc-preview ready! 🔨 Explore the source changes: 019235c 🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs-v3-ja-doc-preview/deploys/619f5342c9777100088b46df 😎 Browse the preview: https://deploy-preview-557--vuejs-v3-ja-doc-preview.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大変遅くなりました!
レビュー 👀 コメント 💬 しました。
確認お願いします!
|
||
- `{Data} props` | ||
- `{SetupContext} context` | ||
|
||
Similar to `this.$props` when using Options API, the `props` object will only contain explicitly declared props. Also, all declared prop keys will be present on the `props` object, regardless of whether it was passed by the parent component or not. Absent optional props will have a value of `undefined`. | ||
オプション API を使うときの `this.$props` と同様に、`props` オブジェクトには明示的に宣言されたプロパティのみが含まれます。また、すべての宣言されたプロパティのキーは、親コンポーネントから渡されたかどうかに関わらず `props` オブジェクトに存在します。宣言されていない省略可能なプロパティは `undefined` という値になります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options API は Composition API の表記とバランスよくしたい (対比のケースだと気になる...) ので、Options API
のママにしておきたいです。
|
||
- **Mapping between Options API Lifecycle Options and Composition API** | ||
- **オプション API のライフサイクルオプションと Composition API のマッピング** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここの Options API
の表記も同じく、そのままで。
function inject<T>( | ||
key: InjectionKey<T> | string, | ||
defaultValue: () => T, | ||
treatDefaultAsFactory: true | ||
): T | ||
``` | ||
|
||
Vue provides an `InjectionKey` interface which is a generic type that extends `Symbol`. It can be used to sync the type of the injected value between the provider and the consumer: | ||
Vue は `Symbol` を拡張したジェネリック型の `InjectionKey` インターフェイスを提供しています。これはプロバイダとコンシューマの間で注入された値の型を同期するために使用できます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provider
と cosumer
の訳も悩ましいですね...
個人的には、ソフトウェア用語としてよく出てくる技術word なので、そのままとしておきたいです。
訳すとしたら最初だけ訳スタイルの原文とカッコ付で訳スタイルが折り合い取れていい気がしています。
Vue は `Symbol` を拡張したジェネリック型の `InjectionKey` インターフェイスを提供しています。これはプロバイダとコンシューマの間で注入された値の型を同期するために使用できます: | |
Vue は `Symbol` を拡張したジェネリック型の `InjectionKey` インターフェイスを提供しています。これは provider (プロバイダ) と comsumer (コンシューマ) の間で注入された値の型を同期するために使用できます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうですね、ドキュメント内でもここが初出で悩み、カタカナのままの判断にしました。
個人的には、ソフトウェア開発上の用語って、最近は英語のままが違和感なくなってきてますね。
一方で、初学者向けにもと考えたとき、正しい読み方を知ってもらう意味でも、カッコ書きのフォローいいですね。
Co-authored-by: kazuya kawaguchi <kawakazu80@gmail.com>
Co-authored-by: kazuya kawaguchi <kawakazu80@gmail.com>
LGTMです! 👍 |
Description of Problem
API リファレンスの Composition API を翻訳します。
https://v3.ja.vuejs.org/api/composition-api.html
Proposed Solution
Additional Information